-
Notifications
You must be signed in to change notification settings - Fork 607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(CL): change full range definition #6380
Conversation
aa4d675
to
13a5552
Compare
// Seed 1694529692 - proves issues in rounding direction of GetNextSqrtPriceFromAmount0InRoundingUp, proving | ||
// that we must not QuoRoundUp for the last term in the formula. | ||
// To repro: set up a breakpoint at the top of computeSwapOutGivenIn, and set count to 15. | ||
// On the third (last) swap step for that swap, observe that the final `sqrtPriceNext` is off by one | ||
// BigDec ULP, showing that this rounding bheavior was the issue. | ||
r := rand.New(rand.NewSource(1694529692)) | ||
s.individualFuzz(r, 0, 30, 10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see this seed.
If the change in #6379 is reverted, this will start running into infinite loop bugs.
|
||
// estimate the amount in to fund | ||
amountZeroIn, _, _ := s.computeSwapAmounts(poolId, pool.GetCurrentSqrtPrice(), types.MinInitializedTick, true, false) | ||
amountZeroIn, _, _ := s.computeSwapAmounts(poolId, pool.GetCurrentSqrtPrice(), types.MinInitializedTickV2, true, false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done here
cacdf04
to
cc63dd6
Compare
Context on latest commit in the PR: Still getting error that #6379 was attempting to get resolved. The investigations have shown that this is an acceptable case where non-zero amount in would yield a zero amount out. So we can adjust our fuzzed to never hit such cases. Fuzzer change is still WIP and needs more tweaking |
Closes:
What is the purpose of the change
Changes the notion of full range to the extended [10^-30, 10^30].
Refactors all remaining logic, including superfluid to utilize the new price range. Removes any previously added fuzzer restrictions. Changes
DefaultMinTick
to the V2 tick in tests.Testing and Verifying
Documentation and Release Note
Unreleased
section ofCHANGELOG.md
?Where is the change documented?
x/{module}/README.md
)